<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册页面</title>
</head>
<body>
<form action="/manage/register/" method="post" enctype="multipart/form-data">
    账号: <input type="text" name="user_name"><br>
    密码: <input type="text" name="pwd"> <br>
    邮箱: <input type="text" name="email" id="email"> <br>
    介绍：<input name="introduce" type="text"> <br>
    现居城市：<input name="address" type="text"> <br>
    用户图片：<input name="file" type="file"> <br>
    验证码：<input name="code" type="text"> 
    <input type="button" id="handleCode" value="点击获取验证码"> <br>
    <input type="submit" value="提交">
</form>
<a href="/manage/login/"></a>
</body>
</html>
<script src="/static/js/jquery.min.js"></script>
<script>
    $(document).ready(() => {
        $('#handleCode').click(() => {
            let email = $('#email').val();
            console.log('email-->', email)
            $.post('/manage/send_code/',
                {email: email},
                resp => {
                    console.log('resp-->', resp)
                    if (resp == '0') {
                        alert("验证码发送成功，请查看邮箱")
                    } else {
                        alert("邮箱错误")
                    }
            })
        })
    })
</script>
